package triDataStruct;

import triBasic.*;

public class CondQueryIntSet implements ISet<Integer> {

	private ReadableMap map;
	private String key;
	
	public CondQueryIntSet(ReadableMap map, String key) {
		this.map = map;
		this.key = key;
	}
	
	public Integer nextItem() {
		String k;
		while (true) {
			k = map.nextKey();
			if (k == null)
				return null;
			//System.out.println("nextItem : " + k);
			if (k.equals(key))
				break;
			else 
				map.nextValue();
		}
		
		return map.nextValue();
	}
	
	public void dispose() {
		map.dispose();
	}
}
